package com.bw.mvvm_common.network;

/**
 * @author KK
 * @description:
 * @date :2021/10/13 15:50
 */
public class HttpFactory {
    private static HttpInterface token,sign,ts,upload;
    public static HttpInterface create(HttpEnum httpEnum) {
        switch (httpEnum) {
            case Upload:
                if (upload == null) {
                    upload = new UploadImpl();
                }
                return upload;

            case Token:
                if (token == null) {
                    token = new TokenImpl();
                }
                return token;

            case Sign:
                if (sign == null) {
                    sign = new SignImpl();
                }
                return sign;

            default:
                if (ts == null) {
                    ts = new TokenSignImpl();
                }
                return ts;
        }

    }
}
